package CharacterString;

import java.util.Scanner;

public class countCharater {
    public static void main(String[] args) {
        //统计字符串里有多少个大写字母，小写字母，数字；
        //
        Scanner sc =new Scanner(System.in);
        System.out.println("输入一个字符串；");
        String str = sc.next();
        //
        int bigCase = 0,smallCase=0,number = 0;
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            if (c >= 'a' && c<= 'z'){
                smallCase++;
            } else if (c >= 'A' && c <= 'Z') {
                bigCase++;
            }else if (c >= '1' && c<= '9'){
                number++;
            }
        }
        System.out.println("大写字母有："+bigCase+",小写字母有："+smallCase+",数字有："+number);
    }
}
